<div class="admin-content" id="accordion">
	<div class="am-cf am-padding">
		<div class="am-fl am-cf">
			<strong class="am-text-primary am-text-lg">门店管理</strong> / <small>Stores</small>
		</div>
	</div>

	<div class="am-g">
		<div class="am-u-sm-12 am-u-md-6">
			<div class="am-btn-toolbar">
				<div class="am-btn-group am-btn-group-xs">
					<button data-ng-click="ToAddStore();" type="button" data-am-offcanvas="{target: '#product-detail'}" class="am-btn am-btn-default">
						<span class="am-icon-plus"></span> 新增
					</button>
				</div>
			</div>
		</div>
	</div>

	<hr />

	<div class="am-panel-default" ng-repeat="store in stores">
		<div class="am-panel-hd">
			<h4 class="am-panel-title" data-am-collapse="{parent: '#accordion', target: '#do-not-say-{{$index}}'}">{{store.name}}</h4>
		</div>

		<div id="do-not-say-{{$index}}" class="am-panel-collapse am-collapse">
			<div class="am-panel-bd">

				<div data-am-offcanvas="{target: '#edit-store'}" class="am-img-bdrs am-img-thumbnail" style="border: none;" data-ng-click="showUpdateStore(store);">
					<img class="am-img-thumbnail am-img-bdrs" ng-src="{{store.image? baseUrl+store.image+formatImage:'sad.png'}}" />
					<div class="gallery-list" style="padding-top: 3%;">
						<input readonly class="am-form-field" type="text" value="{{ store.name }}" />
					</div>
				</div>

				<hr>
				<div>
					<label>店长信息</label>
				</div>
				<div class="alert alert-info">
					<ul class="am-avg-sm-1 am-avg-md-2 am-avg-lg-3 am-margin gallery-list">
						<li data-ng-repeat="manager in managers[$index].object">
							<div class="am-img-bdrs am-img-thumbnail" style="border: none;">
								<img class="am-img-thumbnail am-img-bdrs" ng-src="{{ manager.image? baseUrl+manager.image+formatImage:'sad.png'}}" />
								<div class="gallery-list" style="padding-top: 3%;">
									<input readonly class="am-form-field" type="text" value="{{ manager.name }}" />
								</div>
							</div>
							<div class="am-padding-top-sm">
								<!-- 	<input switch-on-text="√" switch-off-text="×"
									ng-change="changeStatus(product)" bs-switch
									ng-model="product.status" type="checkbox" name="my-checkbox"> -->
								<button class="am-btn am-btn-primary am-btn-sm" data-ng-click="DeleteManager(manager.id,store.id)">删除</button>
							</div>
						</li>
						<li>
							<div data-ng-model="formdata">
								<div>
									<i data-ng-click="add(store)" data-am-offcanvas="{target: '#doc-oc-demo3'}" class="am-icon-plus am-btn am-btn-default am-btn-xl am-round"></i>
								</div>
							</div>

						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- 添加店长 -->
<div id="doc-oc-demo3" name="" class="am-offcanvas" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip am-offcanvas-bar-overlay">
		<!--content start  -->
		<div class="am-offcanvas-content">
			<div class="am-cf am-padding">
				<div class="am-fl am-cf">
					<strong class="am-text-primary am-text-lg">添加店长</strong> <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
				</div>
			</div>

			<hr>

			<div class="am-g" ng-model="nproduct">
				<form name="formName">
					<div class="am-u-sm-12 am-u-md-8">
						<div class="am-form am-form-horizontal">
							<div class="am-g am-margin-top-sm">
								<div class="am-u-sm-4 am-u-md-2 am-text-right">店长：</div>
								<div class="am-u-sm-8 am-u-md-4 am-u-end">
									<select ng-model="managerSelected" name="managers" ng-options="manager as manager.name for manager in managerForSelect">
										<option value="">--请选择店长--</option>
									</select>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
			<hr />
			<button class="am-btn am-btn-primary" data-ng-click="addManager()">确定</button>
			<button class="am-btn am-btn-primary doc-oc-js" data-rel="close" data-ng-click="close()">关闭侧边栏</button>
		</div>
	</div>
</div>
<!-- 增加店  -->
<div id="product-detail" name="{{ open }}" class="am-offcanvas" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
	<div style="background: white; width: 50%;" class="am-offcanvas-bar am-offcanvas-bar-flip am-offcanvas-bar-overlay">
		<!--content start  -->
		<div class="am-offcanvas-content">
			<form class="am-form am-form-horizontal" data-am-validator>
				<fieldset>
					<legend>增加门店</legend>
					
					<div class="am-form-group">
						<label class="am-u-sm-3 am-form-label">店名：</label>
						<div class="am-u-sm-9">
							<img class="am-form-label" data-ng-src="{{ nstore.image? baseUrl+nstore.image+formatImage:'sad.png' }}"> <input type="file" ng-file-select="onFileSelect($files)">
						</div>
					</div>

					<div class="am-form-group">
						<label class="am-u-sm-3 am-form-label">店名：</label>
						<div class="am-u-sm-9">
							<input type="text" placeholder="输入店名/ Name" data-ng-model="nstore.name">
						</div>
					</div>

					<div class="am-form-group">
						<label for="admin-address" class="am-u-sm-3 am-form-label">地址：</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-address" placeholder="请输入地址/ Address" data-ng-model="nstore.address">
						</div>
					</div>

					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<button type="button" class="am-btn am-btn-primary" data-ng-click="addStore(nstore);">保存</button>
							<button type="button" class="am-btn am-btn-primary" data-ng-click="closeEditUI();">关闭</button>
						</div>
					</div>
				</fieldset>
			</form>
		</div>
	</div>
</div>
<!-- 修改店  -->
<div id="edit-store" name="{{ open }}" class="am-offcanvas" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
	<div style="background: white; width: 50%;" class="am-offcanvas-bar am-offcanvas-bar-flip am-offcanvas-bar-overlay">
		<!--content start  -->
		<div class="am-offcanvas-content">
			<form class="am-form am-form-horizontal" data-am-validator>
				<fieldset>
					<legend>修改门店信息</legend>

					<div class="am-form-group">
						<label class="am-u-sm-3 am-form-label">店名：</label>
						<div class="am-u-sm-9">
							<img class="am-form-label" data-ng-src="{{ updatedStore.image? baseUrl+updatedStore.image+formatImage:'sad.png' }}"> 
							<input type="file" ng-file-select="onFileSelectUpdateStore($files)">
						</div>
					</div>

					<div class="am-form-group">
						<label class="am-u-sm-3 am-form-label">店名：</label>
						<div class="am-u-sm-9">
							<input type="text" placeholder="输入店名/ Name" data-ng-model="updatedStore.name">
						</div>
					</div>

					<div class="am-form-group">
						<label for="admin-address" class="am-u-sm-3 am-form-label">地址：</label>
						<div class="am-u-sm-9">
							<input type="text" id="admin-address" placeholder="请输入地址/ Address" data-ng-model="updatedStore.address">
						</div>
					</div>

					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<button type="button" class="am-btn am-btn-primary" data-ng-click="update(updatedStore);">保存</button>
							<button type="button" class="am-btn am-btn-primary" data-ng-click="closeEditUI2();">关闭</button>
						</div>
					</div>
				</fieldset>
			</form>
		</div>
	</div>
</div>